home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Util / Misc / Reportplus.lha / reportplus / source / f4.c < prev    next >
C/C++ Source or Header  |  2003-02-14  |  18KB  |  560 lines

  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3. #include <intuition/intuition.h>
  4. #include <intuition/gadgetclass.h>
  5. #include <workbench/icon.h>
  6. #include <workbench/workbench.h>
  7. #include <dos/dosextens.h>
  8.  
  9. #include "rp.h" // before icon protos
  10.  
  11. #include <clib/alib_protos.h>
  12. #include <clib/exec_protos.h>
  13. #include <clib/intuition_protos.h>
  14. #include <clib/icon_protos.h>
  15. #include <clib/dos_protos.h>
  16. #include <pragmas/icon_pragmas.h>
  17. #include <reaction/reaction.h>
  18. #include <gadgets/chooser.h>
  19. #include <pragmas/chooser_pragmas.h>
  20. #include <gadgets/string.h>
  21. #include <pragmas/string_pragmas.h>
  22. #include <gadgets/checkbox.h>
  23. #include <pragmas/checkbox_pragmas.h>
  24. #include <gadgets/layout.h>
  25. #include <pragmas/layout_pragmas.h>
  26. #include <gadgets/button.h>
  27. #include <pragmas/button_pragmas.h>
  28. #include <images/label.h>
  29. #include <pragmas/label_pragmas.h>
  30. #include <proto/label.h>
  31. #include <classes/window.h>
  32. #include <pragmas/window_pragmas.h>
  33.  
  34. #include <stdlib.h>
  35. #include <string.h>
  36.  
  37. AGLOBAL ABOOL              quit              = FALSE;
  38. AGLOBAL struct Gadget*     icon_gadgets[GIDS_4 + 1];
  39. AGLOBAL struct IconStruct  icon =
  40. {   TRUE, FALSE,
  41.     WBDRAWER, ""
  42. };
  43.  
  44. // from rp.c
  45. IMPORT Object*             WinObject[FUNCTIONS + 1];
  46. IMPORT TEXT                IOBuffer[LONGESTFIELD + 1];
  47. IMPORT SBYTE               page;
  48. IMPORT TEXT                asldir[PATHNAMEFIELD + 1];
  49. IMPORT ULONG               signal;
  50. IMPORT struct Window*      MainWindowPtr;
  51. IMPORT struct Screen*      ScreenPtr;
  52. IMPORT struct SharedStruct shared;
  53. IMPORT struct Library     *ButtonBase,
  54.                           *CheckBoxBase,
  55.                           *ChooserBase,
  56.                           *IconBase,
  57.                           *LabelBase,
  58.                           *LayoutBase,
  59.                           *StringBase,
  60.                           *WindowBase;
  61. IMPORT struct Menu*        MenuPtr;
  62. IMPORT ABOOL               done;
  63. IMPORT TEXT                aslresult[PATHNAMEFIELD + 1];
  64.  
  65. #define ICONOPTIONS        8
  66.  
  67. MODULE ABOOL               stop;
  68. MODULE STRPTR IconOptions[ICONOPTIONS] =
  69. {   "Disk",
  70.     "Drawer",
  71.     "Tool",
  72.     "Project",
  73.     "Trashcan",
  74.     "Device",
  75.     "Kickstart",
  76.     "AppIcon"
  77. };
  78. /* icon.type is the same as the values used by the system. So, the
  79. value used by the gadget is one less than the actual value. */
  80.  
  81. AGLOBAL void icon1(void)
  82. {   ULONG               i;
  83.     struct List         ChooserList;
  84.     struct ChooserNode *ChooserNodePtr[7 + 1];
  85.     struct Hook         Hook4Struct;
  86.  
  87.     icon.pathname[0] = 0;
  88.  
  89.     NewList(&ChooserList);
  90.     for (i = 0; i <= 7; i++)
  91.     {   if (!(ChooserNodePtr[i] = (struct ChooserNode *) AllocChooserNode(CNA_Text, IconOptions[i], TAG_DONE)))
  92.         {   rq("Can't allocate chooser node!");
  93.         }
  94.         AddTail(&ChooserList, (struct Node *) ChooserNodePtr[i]);
  95.     } // automatically freed by ReAction at DisposeObject() time
  96.  
  97.     InitHook(&Hook4Struct, Hook4Func, NULL);
  98.  
  99.     /* Create the window object. */
  100.     lockscreen();
  101.     if (!(WinObject[4] =          NewObject(WINDOW_GetClass(), NULL,
  102.     // window
  103.     WA_PubScreen,                 ScreenPtr,
  104.     WA_ScreenTitle,               "Report+",
  105.     WA_Title,                     "Report+: Icon Processor",
  106.     WA_Activate,                  TRUE,
  107.     WA_DepthGadget,               TRUE,
  108.     WA_DragBar,                   TRUE,
  109.     WA_CloseGadget,               TRUE,
  110.     WA_SizeGadget,                TRUE,
  111.     WA_IDCMP,                     IDCMP_RAWKEY,
  112.     WINDOW_IDCMPHook,             &Hook4Struct,
  113.     WINDOW_IDCMPHookBits,         IDCMP_RAWKEY,
  114.     WINDOW_MenuStrip,             MenuPtr,
  115.     WINDOW_Position,              WPOS_CENTERSCREEN,
  116.     WINDOW_ParentGroup,           icon_gadgets[GID_4_LY1] =
  117.                                   NewObject(LAYOUT_GetClass(), NULL,
  118.         // root-layout
  119.         LAYOUT_Orientation,       LAYOUT_ORIENT_VERT,
  120.         LAYOUT_SpaceOuter,        TRUE,
  121.         LAYOUT_DeferLayout,       TRUE,
  122.         LAYOUT_AddChild,          NewObject(LAYOUT_GetClass(), NULL,
  123.             // layout
  124.             LAYOUT_Orientation,   LAYOUT_ORIENT_HORIZ,
  125.             LAYOUT_VertAlignment, LALIGN_CENTER,
  126.             LAYOUT_HorizAlignment,LALIGN_CENTER,
  127.             LAYOUT_BevelStyle,    BVS_NONE,
  128.             LAYOUT_AddChild,      icon_gadgets[GID_4_CB1] =
  129.                                   NewObject(CHECKBOX_GetClass(), NULL,
  130.                 GA_ID,                GID_4_CB1,
  131.                 GA_RelVerify,         TRUE,
  132.                 GA_Text,              "_Optimize colours?",
  133.                 GA_Selected,          (BOOL) icon.optimize,
  134.             TAG_END),
  135.             CHILD_WeightedHeight,     0,
  136.             LAYOUT_AddImage,          NewObject
  137.             (   LABEL_GetClass(),     NULL,
  138.                 LABEL_Text,           "",
  139.                 TAG_END
  140.             ),
  141.             CHILD_WeightedWidth,      100,
  142.             LAYOUT_AddImage,
  143.             NewObject
  144.             (   LABEL_GetClass(),     NULL,
  145.                 LABEL_Text,           "_Type:",
  146.                 LABEL_Justification,  LJ_LEFT,
  147.             TAG_END),
  148.             CHILD_WeightedWidth,      0,
  149.             LAYOUT_AddChild,          icon_gadgets[GID_4_CH1] =
  150.             NewObject
  151.             (   CHOOSER_GetClass(),   NULL,
  152.                 GA_ID,                GID_4_CH1,
  153.                 GA_RelVerify,         TRUE,
  154.                 CHOOSER_PopUp,        TRUE,
  155.                 CHOOSER_Labels,       &ChooserList,
  156.                 CHOOSER_Selected,     (WORD) (icon.type - 1),
  157.             TAG_END),
  158.             CHILD_WeightedWidth,      0,
  159.         TAG_END), 
  160.         CHILD_WeightedHeight,         0,
  161.         LAYOUT_AddChild,              icon_gadgets[GID_4_CB2] =
  162.                                       NewObject(CHECKBOX_GetClass(), NULL,
  163.                 // checkbox
  164.                 GA_ID,                GID_4_CB2,
  165.                 GA_RelVerify,         TRUE,
  166.                 GA_Text,              "Preserve p_lanar data?",
  167.                 GA_Selected,          (BOOL) icon.planar,
  168.                 TAG_END),
  169.             CHILD_WeightedHeight,     0,
  170.             LAYOUT_AddChild,          NewObject(LAYOUT_GetClass(), NULL,
  171.                 // layout
  172.                 LAYOUT_Orientation,   LAYOUT_ORIENT_HORIZ,
  173.                 LAYOUT_VertAlignment, LALIGN_CENTER,
  174.                 LAYOUT_HorizAlignment,LALIGN_CENTER,
  175.                 LAYOUT_BevelStyle,    BVS_NONE,
  176.                 LAYOUT_AddImage,      NewObject(LABEL_GetClass(), NULL,
  177.                     // label
  178.                     LABEL_Text,       "_Pathname(s):",
  179.                     LABEL_Justification,LJ_LEFT,
  180.                     TAG_END),
  181.                 LAYOUT_AddChild,      icon_gadgets[GID_4_ST1] =
  182.                                       NewObject(STRING_GetClass(), NULL,
  183.                     // string        
  184.                     GA_ID,            GID_4_ST1,
  185.                     GA_RelVerify,     TRUE,
  186.                     STRINGA_TextVal,  icon.pathname,
  187.                     STRINGA_MinVisible,20,
  188.                     TAG_END),
  189.                 LAYOUT_AddChild,      icon_gadgets[GID_4_BU1] =
  190.                                       NewObject(NULL, "button.gadget",
  191.                     // button
  192.                     GA_ID,            GID_4_BU1,
  193.                     GA_RelVerify,     TRUE,
  194.                     BUTTON_AutoButton,BAG_POPFILE,
  195.                     TAG_END),
  196.                 CHILD_WeightedWidth,  0,
  197.                 TAG_END),
  198.             CHILD_WeightedHeight,     0,
  199.             LAYOUT_AddChild,          icon_gadgets[GID_4_ST2] =
  200.                                       NewObject(STRING_GetClass(), NULL,
  201.                 // string        
  202.                 GA_ReadOnly,          TRUE,
  203.                 GA_ID,                GID_4_ST2,
  204.                 STRINGA_TextVal,      "Ready.",
  205.                 TAG_END),
  206.             CHILD_WeightedHeight,     0,
  207.             LAYOUT_AddChild,          NewObject(LAYOUT_GetClass(), NULL,
  208.                 // layout
  209.                 LAYOUT_Orientation,   LAYOUT_ORIENT_HORIZ,
  210.                 LAYOUT_VertAlignment, LALIGN_CENTER,
  211.                 LAYOUT_HorizAlignment,LALIGN_CENTER,
  212.                 LAYOUT_BevelStyle,    BVS_NONE,
  213.                 LAYOUT_AddChild,      icon_gadgets[GID_4_BU3] =
  214.                                       NewObject(NULL, "button.gadget",
  215.                     // button
  216.                     GA_ID,            GID_4_BU3,
  217.                     GA_RelVerify,     TRUE,
  218.                     GA_Text,          "Pro_cess",
  219.                 TAG_END),
  220.                 CHILD_WeightedWidth,  50,
  221.                 LAYOUT_AddChild,      icon_gadgets[GID_4_BU4] =
  222.                                       NewObject(NULL, "button.gadget",
  223.                     // button
  224.                     GA_ID,            GID_4_BU4,
  225.                     GA_RelVerify,     TRUE,
  226.                     GA_Text,          "Stop",
  227.                     GA_Disabled,      TRUE,
  228.                     TAG_END),
  229.                 CHILD_WeightedWidth,  50,
  230.                 TAG_END),
  231.             CHILD_WeightedHeight,     0,
  232.             TAG_END),
  233.     TAG_END)
  234.     ))
  235.     {   rq("Can't create ReAction objects!");
  236.     }
  237.     unlockscreen();
  238.     openwindow();
  239.     ActivateLayoutGadget(icon_gadgets[GID_4_LY1], MainWindowPtr, NULL, (Object) icon_gadgets[GID_4_ST1]);
  240.     loop();
  241.     closewindow();
  242.     if (quit)
  243.     {   cleanexit(EXIT_SUCCESS);
  244. }   }
  245.  
  246. AGLOBAL void icon_do(void)
  247. {   ABOOL  anyfound;
  248.     STRPTR stringptr;
  249.  
  250.     if (!(GetAttr
  251.     (   CHOOSER_Selected, icon_gadgets[GID_4_CH1], (ULONG *) &(icon.type)
  252.     )))
  253.     {   rq("Unsupported inquiry!"); // should never happen
  254.     }
  255.     icon.type++;
  256.  
  257.     if (!(GetAttr
  258.     (   STRINGA_TextVal, icon_gadgets[GID_4_ST1], (ULONG *) &stringptr
  259.     )))
  260.     {   rq("Unsupported inquiry!"); // should never happen
  261.     }
  262.     strcpy(icon.pathname, stringptr);
  263.  
  264.     if (!(GetAttr
  265.     (   GA_Selected, icon_gadgets[GID_4_CB1], (ULONG *) &(icon.optimize)
  266.     )))
  267.     {   rq("Unsupported inquiry!"); // should never happen
  268.     }
  269.     if (!(GetAttr
  270.     (   GA_Selected, icon_gadgets[GID_4_CB2], (ULONG *) &(icon.planar)
  271.     )))
  272.     {   rq("Unsupported inquiry!"); // should never happen
  273.     }
  274.  
  275.     SetGadgetAttrs
  276.     (   icon_gadgets[GID_4_CH1], MainWindowPtr, NULL,
  277.         GA_Disabled, TRUE,
  278.         TAG_END
  279.     );
  280.     SetGadgetAttrs
  281.     (   icon_gadgets[GID_4_CB1], MainWindowPtr, NULL,
  282.         GA_Disabled, TRUE,
  283.         TAG_END
  284.     );
  285.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_CB1], MainWindowPtr, NULL); // needs explicit refresh
  286.     SetGadgetAttrs
  287.     (   icon_gadgets[GID_4_CB2], MainWindowPtr, NULL,
  288.         GA_Disabled, TRUE,
  289.         TAG_END
  290.     );
  291.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_CB2], MainWindowPtr, NULL); // needs explicit refresh
  292.     SetGadgetAttrs
  293.     (   icon_gadgets[GID_4_ST1], MainWindowPtr, NULL,
  294.         GA_Disabled, TRUE,
  295.         TAG_END
  296.     );
  297.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_ST1], MainWindowPtr, NULL); // needs explicit refresh
  298.     SetGadgetAttrs
  299.     (   icon_gadgets[GID_4_BU1], MainWindowPtr, NULL,
  300.         GA_Disabled, TRUE,
  301.         TAG_END
  302.     );
  303.     SetGadgetAttrs
  304.     (   icon_gadgets[GID_4_BU3], MainWindowPtr, NULL,
  305.         GA_Disabled, TRUE,
  306.         TAG_END
  307.     );
  308.     SetGadgetAttrs
  309.     (   icon_gadgets[GID_4_BU4], MainWindowPtr, NULL,
  310.         GA_Disabled, FALSE,
  311.         TAG_END
  312.     );
  313.     SetAttrs
  314.     (   WinObject[4],
  315.         WA_BusyPointer, TRUE,
  316.         TAG_END
  317.     );
  318.     SetGadgetAttrs
  319.     (   icon_gadgets[GID_4_ST2], MainWindowPtr, NULL,
  320.         STRINGA_TextVal, "Resolving wildcards...",
  321.         TAG_END
  322.     );
  323.                           
  324.     strcpy(shared.pathname, icon.pathname);
  325.     anyfound = convert(TRUE);
  326.     strcpy(icon.pathname, shared.pathname);
  327.  
  328.     if (!stop)
  329.     {   if (anyfound)
  330.         {   SetGadgetAttrs
  331.             (   icon_gadgets[GID_4_ST2], MainWindowPtr, NULL,
  332.                 STRINGA_TextVal, "All done.",
  333.             TAG_END);
  334.         } else
  335.         {   SetGadgetAttrs
  336.             (   icon_gadgets[GID_4_ST2], MainWindowPtr, NULL,
  337.                 STRINGA_TextVal, "No matches!",
  338.             TAG_END);
  339.     }   }
  340.     SetAttrs
  341.     (   WinObject[4],
  342.         WA_BusyPointer, FALSE,
  343.         TAG_END
  344.     );
  345.     SetGadgetAttrs
  346.     (   icon_gadgets[GID_4_CH1], MainWindowPtr, NULL,
  347.         GA_Disabled, FALSE,
  348.         TAG_END
  349.     );
  350.     SetGadgetAttrs
  351.     (   icon_gadgets[GID_4_CB1], MainWindowPtr, NULL,
  352.         GA_Disabled, FALSE,
  353.         TAG_END
  354.     );
  355.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_CB1], MainWindowPtr, NULL); // needs explicit refresh
  356.     SetGadgetAttrs
  357.     (   icon_gadgets[GID_4_CB2], MainWindowPtr, NULL,
  358.         GA_Disabled, FALSE,
  359.         TAG_END
  360.     );
  361.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_CB2], MainWindowPtr, NULL); // needs explicit refresh
  362.     SetGadgetAttrs
  363.     (   icon_gadgets[GID_4_ST1], MainWindowPtr, NULL,
  364.         GA_Disabled, FALSE,
  365.         TAG_END
  366.     );
  367.     RefreshGadgets((struct Gadget *) icon_gadgets[GID_4_ST1], MainWindowPtr, NULL); // needs explicit refresh
  368.     SetGadgetAttrs
  369.     (   icon_gadgets[GID_4_BU1], MainWindowPtr, NULL,
  370.         GA_Disabled, FALSE,
  371.         TAG_END
  372.     );
  373.     SetGadgetAttrs
  374.     (   icon_gadgets[GID_4_BU3], MainWindowPtr, NULL,
  375.         GA_Disabled, FALSE,
  376.         TAG_END
  377.     );
  378.     SetGadgetAttrs
  379.     (   icon_gadgets[GID_4_BU4], MainWindowPtr, NULL,
  380.         GA_Disabled, TRUE,
  381.         TAG_END
  382.     );
  383. }
  384.  
  385. AGLOBAL void iconconvert(ABOOL gui)
  386. {   TEXT               saystring[PATHNAMEFIELD + 1 + 14];
  387.     ULONG              length = strlen(shared.thisfile);
  388.     struct DiskObject* IconPtr;
  389.  
  390.     if (length <= 5) // in case we get passed an empty string
  391.     {   return;
  392.     }
  393.     if (!stricmp(&(shared.thisfile[length - 5]), ".info"))
  394.     {   shared.thisfile[length - 5] = 0;
  395.     }
  396.    
  397.     strcpy(saystring, "Processing ");
  398.     strcat(saystring, shared.thisfile);
  399.     strcat(saystring, ".info...");
  400.     if (gui)
  401.     {   SetGadgetAttrs
  402.         (   icon_gadgets[GID_4_ST2], MainWindowPtr, NULL,
  403.             STRINGA_TextVal, saystring,
  404.             TAG_END
  405.         );
  406.     } else
  407.     {   Printf("%s", saystring);
  408.         Flush(Output());
  409.         saystring[0] = 0;
  410.     }
  411.  
  412.     if (IconPtr = GetIconTags(shared.thisfile, TAG_DONE))
  413.     {   IconPtr->do_Type = (UWORD) icon.type;
  414.         if (PutIconTags(shared.thisfile, IconPtr,
  415.             ICONPUTA_NotifyWorkbench,     TRUE,
  416.             ICONPUTA_DropPlanarIconImage, (BOOL) ~(icon.planar),
  417.             ICONPUTA_OptimizeImageSpace,  (BOOL) icon.optimize,
  418.             TAG_DONE
  419.         ))
  420.         {   strcat(saystring, "done.");
  421.         } else strcat(saystring, "failed to write!");
  422.         FreeDiskObject(IconPtr);
  423.     } else strcat(saystring, "failed to read!");
  424.  
  425.     if (gui)
  426.     {   SetGadgetAttrs
  427.         (   icon_gadgets[GID_4_ST2], MainWindowPtr, NULL,
  428.             STRINGA_TextVal, saystring,
  429.             TAG_END
  430.         );
  431.     } else
  432.     {   Printf("%s\n", saystring);
  433.     }
  434.  
  435.     checkabort(gui);
  436. }
  437.  
  438. AGLOBAL void icon_loop(ULONG gid)
  439. {   STRPTR stringptr;
  440.  
  441.     switch (gid)
  442.     {
  443.     case GID_4_CH1:
  444.         if (!(GetAttr
  445.         (   CHOOSER_Selected, icon_gadgets[GID_4_CH1], (ULONG *) &(icon.type)
  446.         )))
  447.         {   rq("Unsupported inquiry!"); // should never happen
  448.         }
  449.         icon.type++;
  450.     break;
  451.     case GID_4_ST1:
  452.         if (!(GetAttr
  453.         (   STRINGA_TextVal, icon_gadgets[GID_4_ST1], (ULONG *) &stringptr
  454.         )))
  455.         {   rq("Unsupported inquiry!"); // should never happen
  456.         }
  457.         strcpy(icon.pathname, stringptr);
  458.     break;
  459.     case GID_4_BU1:
  460.         strcpy(shared.pathname, icon.pathname);
  461.         multiasl("#?.info");
  462.         strcpy(icon.pathname, shared.pathname);
  463.         SetGadgetAttrs
  464.         (   icon_gadgets[GID_4_ST1], MainWindowPtr, NULL,
  465.             STRINGA_TextVal, icon.pathname,
  466.             TAG_END
  467.         );
  468.     break;
  469.     case GID_4_BU3:
  470.         icon_do();
  471.     break;
  472.     case GID_4_CB1:
  473.         if (!(GetAttr
  474.         (   GA_Selected, icon_gadgets[GID_4_CB1], (ULONG *) &(icon.optimize)
  475.         )))
  476.         {   rq("Unsupported inquiry!"); // should never happen
  477.         }
  478.     break;
  479.     case GID_4_CB2:
  480.         if (!(GetAttr
  481.         (   GA_Selected, icon_gadgets[GID_4_CB2], (ULONG *) &(icon.planar)
  482.         )))
  483.         {   rq("Unsupported inquiry!"); // should never happen
  484.         }
  485.     break;
  486.     default:
  487.     break;
  488. }   }
  489.  
  490. AGLOBAL ULONG Hook4Func(struct Hook *h, VOID *o, VOID *msg)
  491. {   /* "When the hook is called, the data argument points to the 
  492.     window object and message argument to the IntuiMessage." */
  493.  
  494.     UWORD code, qual;
  495.  
  496.     geta4(); // wait till here before doing anything
  497.  
  498.     code = ((struct IntuiMessage *) msg)->Code;
  499.     qual = ((struct IntuiMessage *) msg)->Qualifier;
  500.  
  501.     switch(code)
  502.     {
  503.     case SCAN_HELP:
  504.         helpabout();
  505.     break;
  506.     case SCAN_ESCAPE:
  507.         if ((qual & IEQUALIFIER_LSHIFT) || (qual & IEQUALIFIER_RSHIFT))
  508.         {   cleanexit(EXIT_SUCCESS);
  509.         } else page = 0;
  510.     break;
  511.     case SCAN_P:
  512.         ActivateLayoutGadget(icon_gadgets[GID_4_LY1], MainWindowPtr, NULL, (Object) icon_gadgets[GID_4_ST1]);
  513.     break;
  514.     case SCAN_T:
  515.         if ((qual & IEQUALIFIER_LSHIFT) || (qual & IEQUALIFIER_RSHIFT))
  516.         {   if (icon.type == 1)
  517.             {   icon.type = ICONOPTIONS;
  518.             } else icon.type--;
  519.         } else
  520.         {   if (icon.type == ICONOPTIONS)
  521.             {   icon.type = 1;
  522.             } else icon.type++;
  523.         }
  524.  
  525.         SetGadgetAttrs
  526.         (   icon_gadgets[GID_4_CH1], MainWindowPtr, NULL,
  527.             CHOOSER_Selected, icon.type - 1,
  528.             TAG_END
  529.         );
  530.     break;
  531.     case SCAN_PERIOD:
  532.         strcpy(shared.pathname, icon.pathname);
  533.         multiasl("#?.info");
  534.         strcpy(icon.pathname, shared.pathname);
  535.         SetGadgetAttrs
  536.         (   icon_gadgets[GID_4_ST1], MainWindowPtr, NULL,
  537.             STRINGA_TextVal, icon.pathname,
  538.             TAG_END
  539.         );
  540.     break;
  541.     default:
  542.     break;
  543.     }
  544.  
  545.     return(1);
  546. }
  547.  
  548. AGLOBAL void icon_die(void)
  549. {   IOBuffer[16] = (UBYTE) icon.type;
  550.     IOBuffer[17] = (UBYTE) icon.optimize;
  551.     IOBuffer[18] = (UBYTE) icon.planar;
  552. }
  553.  
  554. AGLOBAL void icon_config(void)
  555. {   icon.type     = (ULONG) IOBuffer[16];
  556.     icon.optimize = (ULONG) IOBuffer[17];
  557.     icon.planar   = (ULONG) IOBuffer[18];
  558. }
  559.  
  560.